package com.qf.collection.pk;

import java.util.*;

public class PkDemo {
    public static void main(String[] args) {

        String[] soucre = new String[1000000];
        for (int i = 0; i <soucre.length; i++) {
            soucre[i] =  UUID.randomUUID().toString();
        }

        // 五个集合对象
        ArrayList<String> arrayList = new ArrayList<>();
        LinkedList<String> linkedList = new LinkedList<>();
        HashSet<String> hashSet = new HashSet<>();
        LinkedHashSet<String> linkedHashSet = new LinkedHashSet<>();
        TreeSet<String> treeSet = new TreeSet<>();

        SpeedPK.testAddSpeed(soucre,arrayList);
        SpeedPK.testAddSpeed(soucre,linkedList);
        SpeedPK.testAddSpeed(soucre,hashSet);
        SpeedPK.testAddSpeed(soucre,linkedHashSet);
        SpeedPK.testAddSpeed(soucre,treeSet);

        System.out.println("==============================");
//        SpeedPK.testFindSpeed(soucre,arrayList); //参数选手为：java.util.ArrayList,time=132644
//        SpeedPK.testFindSpeed(soucre,linkedList);
        SpeedPK.testFindSpeed(soucre,hashSet);
        SpeedPK.testFindSpeed(soucre,linkedHashSet);
        SpeedPK.testFindSpeed(soucre,treeSet);


    }
}
